package com.moment.hello.common.annotation;

import java.lang.reflect.Method;

public class TestHelloAnnotation {

    static UseHelloAnnotation useHelloAnnotation = new UseHelloAnnotation();

    public static void main(String argv[]) {
        GetHelloMethodAnnotation getHelloMethodAnnotation = new GetHelloMethodAnnotation(useHelloAnnotation);
        try {
            Method method = useHelloAnnotation.getClass().getMethod("testMethod");
            System.out.println(getHelloMethodAnnotation.getName(method));
            HelloAnnotation.Status status = getHelloMethodAnnotation.getStatus(method);
            if (status == HelloAnnotation.Status.PROCESSING) {
                System.out.println("is coming for you");
            }
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        useHelloAnnotation.testMethod();
    }
}
